package cn.jdy.plugins.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.jdy.common.ctrl.BaseCtrl;
import cn.jdy.platform.service.ConfService;
import cn.jdy.plugins.entity.ServerPoint;
import cn.jdy.plugins.service.ServerPointService;

/**
 * @title 邮政服务网点前台模块
 * @author yangyingming
 * @since 23-11-2015
 */
@Controller
@RequestMapping("/serverPoint")
public class ServerPointCtrl extends BaseCtrl{
	@Autowired
	private ServerPointService serverPointService;
	@Autowired
	private ConfService confService;
	
	/**
	 *  初始化
	 * @return
	 */
	@RequestMapping("")
	public ModelAndView list(ServerPoint sp) {
		ModelAndView mv = new ModelAndView("/serverPointList.jsp");
		mv.addObject("dataList", serverPointService.query(sp));
		return mv;
	}
	
	/**
	 * 由ID查询数据，跳转至serverPointDetail.jsp
	 * @param id
	 * @return
	 */
	@RequestMapping("/mapdetail/{id}")
	public ModelAndView edit(@PathVariable Long id) {
		ModelAndView mv = new ModelAndView("/serverPointDetail.jsp");
		mv.addObject("data", id==null||id==0 ? id : this.serverPointService.find(id));
		return mv;
	}
}
